import request from '../utils/request.js'


//获取文章所有评论
export const commentListService = (params) => {
    return  request.get('/comment/list',{params:params})
}

//添加评论
export const commentAddService = (articleid,comment) => {

    const params = new URLSearchParams()
    params.append('id',articleid)
    params.append('content',comment)
    return request.post('/comment/add',params)
  
}

//获取用户所有评论
export const usercommentListService = () => {

    return request.get('/comment/usercomment')

}

//删除评论
export const commentDeleteService = (id) => {

    return request.delete('/comment/delete?id='+id)
  
}